# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=libxtst
pkgver=1.2.4
pkgrel=1
pkgdesc="X11 Testing -- Resource extension library"
arch=('loong64' 'x86_64')
url="https://xorg.freedesktop.org/"
license=('custom')
depends=('libxext' 'libxi' 'libxfixes')
makedepends=('xorg-util-macros' 'xorgproto')
options=('debug')
source=(${url}/releases/individual/lib/libXtst-${pkgver}.tar.xz{,.sig})
sha512sums=('f2f4e01239b892b8e26284cede90feb4fe7738beb243bca0f6adb349029f8bf87b5a482911edcd2401733c92ef78eec07fcd455b92e5b8c4828374769e60098d'
            'SKIP')
#validpgpkeys=('C41C985FDCF1E5364576638B687393EE37D128F8') # Matthieu Herrb <matthieu.herrb@laas.fr>
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>

build() {
  cd "${srcdir}/libXtst-${pkgver}"
  ./configure --prefix=/usr --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd "${srcdir}/libXtst-${pkgver}"
  make DESTDIR="${pkgdir}" install

  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
